package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.NursingPlan;
import com.zzyl.vo.NursingPlanVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;

import java.util.List;

@Mapper
public interface NursingPlanMapper {
    /**
     * 查询所有的护理计划
     */
    List<NursingPlanVO> selectAllPlan();

    /**
     * 新增护理计划
     */
    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("INSERT INTO nursing_plan (id, sort_no, plan_name, status, create_time, update_time, create_by, update_by, remark)\n" +
            "VALUES (null, #{sortNo}, #{planName}, #{status}, #{createTime}, #{updateTime}, #{createBy}, #{updateBy}, #{remark})")
    void addNursingPlan(NursingPlan nursingPlan);

    Page<NursingPlanVO> selectByPage(String name, Integer status);

    void update(NursingPlan nursingPlan);

    NursingPlanVO getNursingPlan(Long id);

    /**
     * 删除
     */
    void deleteById(Long id);

    /**
     * 启用和禁用
     */
    void updateStatus(Long id, Integer status);
}
